#ifndef BuildTree_h__
#define BuildTree_h__

#include <string>
#include <vector>
#include <stack>
#include "MyInclude.h"

class CBuildTree
{
public:
	CBuildTree();
	~CBuildTree();

	void Build(std::string statement);
	bool Compute();
	void Assign(char*, bool);

private:
	BooleanExp* _expression;
	Context _mContext;

private:
	void standardsplit(const std::string& s, std::vector<std::string>& tokens, const std::string& delimiters = " ");
	void Mysplit(const std::string& s, std::vector<std::string>& tokens);
	int CountBrackets(const std::string& str, const char* bracket);
	BooleanExp* stack_pop(std::stack<BooleanExp*>& m_stack);
	void DoTerminal(std::stack<BooleanExp*>& m_stack, BooleanExp* terminalExp);
	bool isNonTerminal(BooleanExp*);
};


#endif // BuildTree_h__